modules: fix device widgets for tunnel devices
authorPaul Donald <[email protected]>
Fri, 13 Jun 2025 22:11:04 +0000 (00:11 +0200)
committerPaul Donald <[email protected]>
Fri, 13 Jun 2025 22:13:52 +0000 (00:13 +0200)
commitfd0038d1831151fb44147e462e2c87d1f6f649eb
treef256b7b89d4e4f4a3e1e5a9381d3c6116b1f6c6d
parent85fde70cd212177c83456063f781c72589565c4c
modules: fix device widgets for tunnel devices

Returning a device via getDevice() doesn't work out for tunnel configs,
like wireguard-wg0. Its dev property (for determining dev.getType()) is
always empty, but device is 'wireguard-wg0' and network is 'wg0'.

getDevice() returns an instantiated prototype which is not up, defeating
the purpose of querying its 'up' status.

When dealing with firewall zones and device widgets, what's interesting
is the dev. And getL3Device() is intended for this.

This effectively reverts commit f17ae7fd96f285aa564579f597f51e2679b27fd4
which attempted to address the problem of 'up' status; now calls via
getL3Device() get the correct up status.

Signed-off-by: Paul Donald <[email protected]>
modules/luci-base/htdocs/luci-static/resources/tools/widgets.js
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js